@import '../../../styles/tokens.css';

p {
  margin: 0;
}

.EventPopoverPositioner {
  max-width: 460px;
  overflow: hidden;
}

.EventPopoverHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  background-color: var(--event-color-3);
  padding: var(--space-6);
}

.EventPopoverHeaderContent {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mui-x-scheduler .EventPopoverCloseButton {
  padding: var(--space-1);
  display: flex;
  border-radius: var(--radius-4);
  background-color: var(--event-color-3);
}

.mui-x-scheduler .EventPopoverCloseButton:hover {
  background-color: var(--event-color-4);
}

.mui-x-scheduler .EventPopoverCloseButton:active {
  background-color: var(--event-color-5);
}

.mui-x-scheduler .EventPopoverCloseButton:focus-visible {
  outline: 2px solid var(--event-color-5);
  outline-offset: var(--outline-focus-offset);
}

.mui-x-scheduler .PopoverPositioner .PrimaryButton:focus-visible,
.mui-x-scheduler .PopoverPositioner .SecondaryErrorButton:focus-visible {
  outline: 2px solid var(--event-color-5);
}

.mui-x-scheduler .EventPopoverTitleInput {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-4);
  color: var(--event-color-12);
  font-size: var(--font-size-3);
  line-height: var(--line-height-3);
  font-weight: var(--font-weight-2);
  background-color: var(--event-color-4);
}

.EventPopoverMainContent {
  padding: var(--space-6);
}

.EventPopoverMainContent > :not(:first-child, .EventPopoverSeparator) {
  margin-block-start: var(--space-5);
}

.EventPopoverMainContent > :not(:last-child, .EventPopoverSeparator) {
  margin-block-end: var(--space-5);
}

.EventPopoverSeparator {
  height: 1px;
  width: 100%;
  background-color: var(--border-color);
}

.EventPopoverFormLabel {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--secondary-text-color);
  font-size: var(--font-size-1);
}

.mui-x-scheduler .EventPopoverInput,
.mui-x-scheduler .EventPopoverTextarea {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-4);
  color: var(--default-text-color);
  font-size: var(--font-size-2);
  line-height: var(--line-height-1);
}

.mui-x-scheduler .EventPopoverInput {
  max-height: var(--space-7);
}

.mui-x-scheduler .EventPopoverInput:disabled {
  color: var(--disabled-text-color);
}

.mui-x-scheduler .EventPopoverTitleInput:focus-visible {
  outline: 2px solid var(--event-color-5);
  outline-offset: var(--outline-focus-offset);
}

.mui-x-scheduler .EventPopoverInput:focus-visible,
.mui-x-scheduler .EventPopoverTextarea:focus-visible {
  outline: 2px solid var(--gray-3);
  outline-offset: var(--outline-focus-offset);
}

.EventPopoverDateTimeFields {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.EventPopoverDateTimeFieldsStartRow,
.EventPopoverDateTimeFieldsEndRow {
  display: flex;
  gap: var(--space-2);
}
.EventPopoverDateTimeFieldsStartRow > :first-child,
.EventPopoverDateTimeFieldsEndRow > :first-child {
  flex: 1.5 1 0%;
}

.EventPopoverDateTimeFieldsStartRow > :nth-child(2),
.EventPopoverDateTimeFieldsEndRow > :nth-child(2) {
  flex: 1 1 0%;
}

.EventPopoverRequiredFieldError {
  color: var(--error-9);
  font-size: var(--font-size-1);
  margin-block-start: var(--space-2);
}

.EventPopoverDateTimeFieldsError {
  color: var(--error-9);
  font-size: var(--font-size-1);
  grid-column: span 2;
}

.EventPopoverActions {
  display: flex;
  justify-content: space-between;
  padding: var(--space-4);
}

.AllDayCheckboxLabel {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--secondary-text-color);
  font-size: var(--font-size-1);
}
.AllDayCheckboxRoot {
  box-sizing: border-box;
  display: flex;
  width: 1rem;
  height: 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  outline: 0;
  padding: 0;
  margin: 0;
  border: none;

  &[data-unchecked] {
    border: 1px solid var(--gray-8);
    background-color: transparent;
  }

  &[data-checked] {
    background-color: var(--gray-12);
  }

  &:focus-visible {
    outline: 2px solid var(--gray-3);
    outline-offset: 2px;
  }

  &[data-disabled] {
    cursor: var(--cursor-disabled);
    &[data-checked] {
      background-color: var(--disabled-text-color);
    }
  }
}

.AllDayCheckboxIndicator {
  display: flex;
  color: var(--gray-1);

  &[data-unchecked] {
    display: none;
  }
}

.AllDayCheckboxIcon {
  width: 0.8rem;
  height: 0.8rem;
}

.EventPopoverSelectTrigger,
button.Button.EventPopoverMenuTrigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 10px var(--space-2) var(--space-3);
  width: fit-content;
  max-height: var(--space-7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-4);
  font-size: var(--font-size-2);
  line-height: var(--line-height-1);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  font-weight: var(--font-weight-1);
}

.EventPopoverSelectTrigger:focus-visible,
.EventPopoverMenuTrigger:focus-visible {
  outline: 2px solid var(--gray-3);
  outline-offset: var(--outline-focus-offset);
}

.EventPopoverSelectTrigger.Ghost,
button.Button.EventPopoverMenuTrigger.Ghost {
  background-color: transparent;
  border: 1px solid transparent;
}

.EventPopoverSelectTrigger.Ghost[data-popup-open],
.EventPopoverMenuTrigger.Ghost[data-popup-open] {
  background-color: var(--event-color-4);
}

.EventPopoverSelectIcon {
  display: flex;
}

.EventPopoverSelectPositioner {
  z-index: 10000;
}

.EventPopoverSelectPopup {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-1);
  border-radius: var(--radius-4);
  background-color: var(--surface);
  box-shadow: var(--shadow-5);
  outline: 1px solid var(--border-color);
}

.EventPopoverSelectItem,
.EventPopoverMenuItem {
  background-color: var(--surface);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  border-radius: var(--radius-3);
  font-size: var(--font-size-2);
  line-height: var(--line-height-1);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.EventPopoverMenuItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.EventPopoverSelectItem:hover,
.EventPopoverSelectItem[data-highlighted],
.EventPopoverMenuItem:hover,
.EventPopoverMenuItem[data-highlighted] {
  background-color: var(--interactive-hover-bg);
}

.EventPopoverSelectItem[data-selected],
.EventPopoverMenuItem[data-selected] {
  background: var(--interactive-selected-bg);
}

.EventPopoverSelectItem[data-selected]:hover,
.EventPopoverMenuItem[data-selected]:hover {
  background: var(--interactive-selected-hover-bg);
}

.EventPopoverSelectItem:focus-visible,
.EventPopoverMenuItem:focus-visible {
  outline: 2px solid var(--gray-3);
  outline-offset: var(--outline-focus-offset);
}

.EventPopoverSelectItemTitleWrapper,
.EventPopoverMenuItemTitleWrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.EventPopoverFieldRoot[data-disabled] {
  & input,
  & textarea {
    cursor: var(--cursor-disabled);
    color: var(--disabled-text-color);
  }

  .EventPopoverSelectTrigger {
    color: var(--disabled-text-color);
    cursor: var(--cursor-disabled);
  }

  .EventPopoverFormLabel,
  .AllDayCheckboxLabel {
    color: var(--disabled-text-color);
  }
}

.EventPopoverEditDisabledNotice {
  margin: 0;
  padding: var(--space-2);
  font-size: var(--font-size-1);
  line-height: var(--line-height-1);
  color: var(--event-color-9);
  border: 1px solid var(--event-color-6);
  border-radius: var(--radius-4);
}

.EventPopoverTitle {
  flex: 1;
  color: var(--event-color-12);
  font-size: var(--font-size-3);
  line-height: var(--line-height-3);
  font-weight: var(--font-weight-2);
  margin: 0;
}

.EventPopoverResourceContainer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.EventPopoverResourceTitle {
  font-size: var(--font-size-2);
  color: var(--event-color-11);
}

.ReadonlyContent {
  display: flex;
  flex-direction: column;
  padding: var(--space-4) var(--space-4);
  color: var(--default-text-color);
  gap: var(--space-2);
}

.EventPopoverDateTimeContainer {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.EventPopoverDateTimeContainer .EventDate,
.EventPopoverDateTimeContainer .EventTime,
.EventPopoverDateTimeContainer .EventAllDay {
  font-size: var(--font-size-2);
}

.EventRecurrence {
  font-size: var(--font-size-2);
  color: var(--secondary-text-color);
}

.EventPopoverResourceLegendContainer {
  display: flex;
  align-items: center;
  justify-content: center;
}

.EventPopoverResourceLegendContainer > *:nth-child(n + 2) {
  margin-left: calc(var(--space-05) * -1);
}

.ColorRadioItemCircle {
  width: var(--space-3);
  height: var(--space-3);
  border-radius: 50%;
  background-color: var(--event-color-8);
}

.ColorRadioGroup {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  width: 100%;
  max-width: 190px;
  flex-wrap: wrap;
}

.EventPopoverTabsList {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background-color: var(--event-color-3);
  padding-inline: var(--space-6);
}

.EventPopoverTabTrigger.Ghost {
  border-radius: var(--radius-3) var(--radius-3) 0 0;
  padding: var(--space-2) var(--space-3);
  color: var(--event-color-12);
  font-size: var(--font-size-2);
  line-height: var(--line-height-1);
}

.EventPopoverTabTrigger.Ghost[data-selected] {
  background-color: var(--surface);
}

.EventPopoverRecurrenceFieldset {
  border: none;
  padding: 0;
  margin: 0;

  &[data-disabled] {
    color: var(--disabled-text-color);
    pointer-events: none;
  }
}

.EventPopoverRecurrenceFormLabel {
  display: inline-block;
  font-size: var(--font-size-2);
  font-weight: var(--font-weight-2);
  padding: 0;
  margin: 0 0 var(--space-3) 0;
}

.EventPopoverInputsRow {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-2);
}

.EventPopoverAfterTimesInputWrapper {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.RecurrenceNumberInput {
  max-width: var(--space-10);
}

.EventPopoverRadioRoot {
  display: grid;
  grid-template-columns: 16px auto;
  gap: var(--space-2);
}

.EventPopoverRadioItemText {
  grid-column: 2 / 3;
}

.RadioItem.EventPopoverRecurrenceEndItem {
  justify-content: flex-start;
  gap: var(--space-2);
}
